1. Technical Field
The present disclosure relates to memory caching and, more specifically, to a two-dimensional memory caching apparatus for high definition video.
2. Description of Related Art
A cache is a collection of data that has been copied from an original source where the original source is more expensive to fetch from, for example, in terms of access time or data traffic, than the location of the cache. The term cache may also refer to the memory device that is used to store the collection of data.
A microprocessor such as a central processing unit (CPU) of a computer, a specialized processor such as a video signal processor or any other host device may use a cache to increase processing performance by avoiding having to fetch data from a more expensive source, such as main memory. The cache may be stored in high-speed memory that is highly integrated with the processor. For example, the cache may be stored on the same chip as the processor. In other configurations, a cache may be embodied in a discrete memory component that is faster and/or more accessible than the main memory.
The cache may store a set of entries where each entry is populated with data fetched from main memory. Each entry may also include a tag. The tag represents the location that the data was copied from in the original source. When the processor desires to read data, the processor may first look to the cache. If the desired data is found in the cache (a cache hit), then a reading from the main memory may foe saved. Because relatively expensive high-speed storage is often used as a cache, the amount of available storage in the cache is typically lower than the total amount of data stored in main memory. For this reason, typically, only a small part of the main memory data is copied to the cache at a given time. When the processor cannot find the desired data in the cache (cache miss), the processor must fetch the desired data directly from the main memory.
There are multiple ways in which a cache can be organized. In a fully associative cache, data of main memory may be stored in any cache entry. While a fully associative cache has the flexibility to store any data at any available entry, all cached entries must be checked for the desired data before fetching from main memory. Another example, is a directly mapped cache, which has only one possible entry for a given range of data in main memory. Accordingly, only one location in the cache needs to be checked when attempting to read data from the cache. However, the directly mapped cache lacks the flexibility to accommodate multiple units of data from the same range of main memory. Therefore, even a relatively empty cache may not he able to store additional data without overwriting existing data if that data happens to come from the same range of main memory.
A set associative cache is organized as a compromise between the directly mapped cache and the fully associative cache. In the set associative cache, any particular location in main memory may be cached in one of a limited number of entries. The set associative cache is named according to this limited number. For example, in a 2-way set associative cache, a particular location in main memory may be cached to one of two possible locations, while in a 4-way set associative cache, there would he four possible locations.
The ability of a cache to speed up the operation of the processor and/or to lessen data traffic is dictated by the ability to provide cache hits rather than cache misses. Increasing the size of the cache is one way of increasing the rate of cache hits (hit rate). However, this approach often results in increased manufacturing costs for the device incorporating the cache.
The growing popularity of high-definition video processing has placed increased demands on the computing power of processors associated with high definition video encoding and/or decoding. This is in part the result of a video processing step known as motion compensation. In motion compensation, a picture element, for example a block of pixels, is described in terms of its relation to a similar block of pixels that may be above, below, to the left, or to the right of the block or in a previous frame. By defining the picture element in this way, less data is necessary to represent the same picture. Motion compensation involves high amounts of memory traffic resulting in both significant memory bandwidth and increased power requirements. This is especially true of high definition video processors using the H.264 video compression standard. Moreover, high definition video decoders must achieve high performance at a low cost in order to be commercially successful. However, conventional cache systems may not be adequate to meet the needs of high definition video encoding and/or decoding while minimizing the cost of manufacture.